package com.le.tester.javaThink.fifth.chapter18_Str;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * createTime：2021/8/16 17:42
 * description：使用reset方法
 */
public class Resetting {
    public static void main(String[] args) {
        Matcher matcher = Pattern.compile("[frb][aiu][gx]").matcher("fix the rug with bags");
        while (matcher.find()) {
            System.out.print(matcher.group() + " ");
        }
        System.out.println();

        matcher.reset("fix the rig with rags");

        while (matcher.find()) {
            System.out.print(matcher.group() + " ");
        }
    }
}
